#include <stdlib.h>
#include <time.h>
#include <stdio.h>

double randDouble() {
  double t = rand()/(double)RAND_MAX;
  double i = rand();

  return t+i;
}

/* Saxpy */
int main(const int argc, const char* argv[])
{
  int n, i;
  double *x, *y;
  double a;
  srand(time(NULL));

//  if (argc != 2)
//    exit(1);

  a = randDouble();
 // n = atoi(argv[1]);
  n = 1000;

  x = malloc(n*sizeof(double));
  y = malloc(n*sizeof(double));
  for(i=0; i<n; i++) {
    x[i] = randDouble();
    y[i] = randDouble();
  }
  for(i=0; i<n; i++) {
    y[i] = x[i]*a + y[i];
	printf("%f\n", y[i]);
  }

  return 0;
}
